package com.excemly.library.service;

import com.excemly.library.entity.Admin;
import com.excemly.library.repository.AdminRepository;
import org.springframework.stereotype.Service;
//管理员业务逻辑类，提供 authenticate 方法（通过 AdminRepository 查询管理员）
@Service
public class AdminService {

    private final AdminRepository adminRepository;

    public AdminService(AdminRepository adminRepository) {
        this.adminRepository = adminRepository;
    }

    public Admin authenticate(String username, String password) {
        return adminRepository.findByUsernameAndPassword(username, password);
    }
}